package com.luo.ai.assistant.conv.dao;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.luo.ai.assistant.conv.model.ConvPageQuery;
import com.luo.ai.assistant.conv.model.Conversation;
import com.luo.ai.assistant.file.dao.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;

/**
 * 会话DAO
 *
 * @author luohq
 * @date 2025-02-05
 */
@Mapper
public interface ConversationMapper extends MyBaseMapper<Conversation> {

    /**
     * 分页查询会话记录
     *
     * @param pageQuery 查询参数
     * @return 会话分页列表
     */
    default Page<Conversation> findPage(ConvPageQuery pageQuery) {
        return this.selectPage(this.toPage(pageQuery), Wrappers.emptyWrapper());
    }
}